import { parse } from 'url';
import webpath from '@/utils/webpath';
import moment from 'moment';
// mock tableListDataSource
//let tableListDataSource = [];
//for (let i = 0; i < 46; i += 1) {
//  tableListDataSource.push({
//      index: `${i + 1}`,
//      user_name: `张某 ${i}`,
//      sex: `男`,
//      nation: `汉族`,
//      user_type: `综合管理警官`,
//      creator_id: `李海波 creator_id ${i}`,
//      jh: `00024${i}`,
//      jmsfz: `13092419680908321${i}`,
//      jg: `内蒙古赤峰翁牛特旗`,
//      jkzk: `健康`,
//      zzmm: `中共党员`,
//  });
//}

let tableListDataSource = [
	{
		title: "第一批",
		key: "1",
		children: [
			{serial_number:"1",unit:"内蒙古自治区呼和浩特市公安局", name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
			{serial_number:"2",unit:"内蒙古自治区兴安盟公安局", name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
			{serial_number:"3",unit:"内蒙古自治区乌兰察布市公安局", name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
			{serial_number:"4",unit:"内蒙古自治区呼和浩特市公安局", name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
			{serial_number:"5",unit:"内蒙古自治区辽通市公安局", name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
			{serial_number:"6",unit:"内蒙古自治区乌海市公安局", name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
		]
	},
	{
		title: "第二批",
		key: '2',
		children: [
			{serial_number:"7",unit:"内蒙古自治区乌海市公安局", name:"武某", sex:"男", date_of_birth:"1974-06-27", working_hours:"1999-08-24", educational_system:"4", post:"科员", duty_level:"三级警长", appointment_time:"1999-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2014-09-24"},
			{serial_number:"8",unit:"内蒙古自治区呼和浩特市公安局", name:"埃某", sex:"男", date_of_birth:"1974-07-31", working_hours:"1993-08-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1994-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2019-04-22"},
			{serial_number:"9",unit:"内蒙古自治区乌海市公安局", name:"邹某", sex:"男", date_of_birth:"1987-12-24", working_hours:"1991-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1992-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2006-09-27"},
			{serial_number:"10",unit:"内蒙古自治区乌兰察布市公安局", name:"顾某", sex:"男", date_of_birth:"1976-02-24", working_hours:"1992-08-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-08-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2018-09-12"}
		]
	}
]

const treeData = [
  {
    title: 'Node1',
    value: '0-0',
    key: '0-0',
    children: [
      {
        title: 'Child Node1',
        value: '0-0-1',
        key: '0-0-1',
        isLeaf: true,
      },
      {
        title: 'Child Node2',
        value: '0-0-2',
        key: '0-0-2',
        isLeaf: true,
      },
    ],
  },
  {
    title: 'Node2',
    value: '0-1',
    key: '0-1',
  },
];


const policerankTree = [
  {
    title: '警衔',
    value: '0',
    key: '0',
    children: [
      {
        title: '未授衔',
        value: '0-1',
        key: '0-1',
        isLeaf: true,
      },
      {
        title: '警监',
        value: '0-2',
        key: '0-2',
        children: [
        	{
		        title: '总警监',
		        value: '0-2-1',
		        key: '0-2-1',
		        isLeaf: true,
		      },
        	{
		        title: '副总警监',
		        value: '0-2-2',
		        key: '0-2-2',
		        isLeaf: true,
		      },
        	{
		        title: '一级警监',
		        value: '0-2-3',
		        key: '0-2-3',
		        isLeaf: true,
		      },
        	{
		        title: '二级警监',
		        value: '0-2-4',
		        key: '0-2-4',
		        isLeaf: true,
		      },
        	{
		        title: '三级警监',
		        value: '0-2-5',
		        key: '0-2-5',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '警督',
        value: '0-3',
        key: '0-3',
        children: [
        	{
		        title: '一级警督',
		        value: '0-3-1',
		        key: '0-3-1',
		        isLeaf: true,
		      },
        	{
		        title: '二级警督',
		        value: '0-3-2',
		        key: '0-3-2',
		        isLeaf: true,
		      },
        	{
		        title: '三级警督',
		        value: '0-3-3',
		        key: '0-3-3',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '警司',
        value: '0-4',
        key: '0-4',
        children: [
        	{
		        title: '一级警司',
		        value: '0-4-1',
		        key: '0-4-1',
		        isLeaf: true,
		      },
        	{
		        title: '二级警司',
		        value: '0-4-2',
		        key: '0-4-2',
		        isLeaf: true,
		      },
        	{
		        title: '三级警司',
		        value: '0-4-3',
		        key: '0-4-3',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '警员',
        value: '0-5',
        key: '0-5',
        children: [
        	{
		        title: '一级警员',
		        value: '0-5-1',
		        key: '0-5-1',
		        isLeaf: true,
		      },
        	{
		        title: '二级警员',
		        value: '0-5-2',
		        key: '0-5-2',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '专业技术警监',
        value: '0-6',
        key: '0-6',
        children: [
        	{
		        title: '专业技术总警监',
		        value: '0-6-1',
		        key: '0-6-1',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术副总警监',
		        value: '0-6-2',
		        key: '0-6-2',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术一级警监',
		        value: '0-6-3',
		        key: '0-6-3',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术二级警监',
		        value: '0-6-4',
		        key: '0-6-4',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术三级警监',
		        value: '0-6-5',
		        key: '0-6-5',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '专业技术警督',
        value: '0-7',
        key: '0-7',
        children: [
        	{
		        title: '专业技术一级警督',
		        value: '0-7-1',
		        key: '0-7-1',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术二级警督',
		        value: '0-7-2',
		        key: '0-7-2',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术三级警督',
		        value: '0-7-3',
		        key: '0-7-3',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '专业技术警司',
        value: '0-8',
        key: '0-8',
        children: [
        	{
		        title: '专业技术一级警司',
		        value: '0-8-1',
		        key: '0-8-1',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术二级警司',
		        value: '0-8-2',
		        key: '0-8-2',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术三级警司',
		        value: '0-8-3',
		        key: '0-8-3',
		        isLeaf: true,
		      },
        ]
      },
      {
        title: '专业技术警员',
        value: '0-9',
        key: '0-9',
        children: [
        	{
		        title: '专业技术一级警员',
		        value: '0-9-1',
		        key: '0-9-1',
		        isLeaf: true,
		      },
        	{
		        title: '专业技术二级警员',
		        value: '0-9-2',
		        key: '0-9-2',
		        isLeaf: true,
		      },
        ]
      },
    ],
  }
];

const dutylevelTree = [
  {
    title: '公务员',
    value: '0',
    key: '0',
    children: [
      {
        title: '国家级正职',
        value: '0-0-1',
        key: '0-0-1',
		isLeaf: true,
      },
      {
        title: '国家级副职',
        value: '0-0-2',
        key: '0-0-2',
		isLeaf: true,
      },
	  {
        title: '省部级正职',
        value: '0-0-3',
        key: '0-0-3',
		isLeaf: true,
      },
	  {
        title: '省部级副职',
        value: '0-0-4',
        key: '0-0-4',
		isLeaf: true,
      },
	  {
        title: '厅局级正职',
        value: '0-0-5',
        key: '0-0-5',
		isLeaf: true,
      },
    ]
  },

  {
    title: '人民警察警员职务序列',
    value: '1',
    key: '1',
    children: [
      {
        title: '一级警长',
        value: '0-0-1-1',
        key: '0-0-1-1',
		isLeaf: true,
      },
      {
        title: '二级警长',
        value: '0-0-2-1',
        key: '0-0-2-1',
		isLeaf: true,
      },
	  {
        title: '三级警长',
        value: '0-0-3-1',
        key: '0-0-3-1',
		isLeaf: true,
      },
	  {
        title: '四级警长',
        value: '0-0-4-1',
        key: '0-0-4-1',
		isLeaf: true,
      },
	  {
        title: '一级警员',
        value: '0-0-5-1',
        key: '0-0-5-1',
		isLeaf: true,
      },
    ]
  },

  {
    title: '执法勤务警员职级',
    value: '2',
    key: '2',
    children: [
      {
        title: '一级警务专员',
        value: '0-0-1-1-1',
        key: '0-0-1-1-1',
		isLeaf: true,
      },
      {
        title: '二级警务专员',
        value: '0-0-2-1-1',
        key: '0-0-2-1-1',
		isLeaf: true,
      },
	  {
        title: '一级高级警长',
        value: '0-0-3-1-1',
        key: '0-0-3-1-1',
		isLeaf: true,
      },
	  {
        title: '二级高级警长',
        value: '0-0-4-1-1',
        key: '0-0-4-1-1',
		isLeaf: true,
      },
	  {
        title: '三级高级警长',
        value: '0-0-5-1-1',
        key: '0-0-5-1-1',
		isLeaf: true,
      },
    ]
  },

  {
    title: '警务技术类警员职级',
    value: '3',
    key: '3',
    children: [
      {
        title: '警务技术一级总监',
        value: '1-0-1',
        key: '1-0-1',
		isLeaf: true,
      },
      {
        title: '警务技术二级总监',
        value: '1-0-2',
        key: '1-0-2',
		isLeaf: true,
      },
	  {
        title: '警务技术一级主任',
        value: '1-0-3',
        key: '1-0-3',
		isLeaf: true,
      },
	  {
        title: '警务技术二级主任',
        value: '1-0-4',
        key: '1-0-4',
		isLeaf: true,
      },
	  {
        title: '警务技术二级主任',
        value: '1-0-5',
        key: '1-0-5',
		isLeaf: true,
      },
    ]
  },

  {
    title: '综合管理类警员职级',
    value: '4',
    key: '4',
    children: [
      {
        title: '一级巡视员',
        value: '2-0-1',
        key: '2-0-1',
		isLeaf: true,
      },
      {
        title: '二级巡视员',
        value: '2-0-2',
        key: '2-0-2',
		isLeaf: true,
      },
	  {
        title: '一级调研员',
        value: '2-0-3',
        key: '2-0-3',
		isLeaf: true,
      },
	  {
        title: '二级调研员',
        value: '2-0-4',
        key: '2-0-4',
		isLeaf: true,
      },
	  {
        title: '三级调研员',
        value: '2-0-5',
        key: '2-0-5',
		isLeaf: true,
      },
    ]
  },

  {
    title: '专业技术职务级别',
    value: '5',
    key: '5',
    children: [
      {
        title: '高级',
        value: '3-0-1',
        key: '3-0-1',
		 children: [
		  {
        title: '正高级（教授级）',
        value: '3-0-2-1',
        key: '3-0-2-1',
		isLeaf: true,
          },
		  {
        title: '副高级（副教授级）',
        value: '3-0-2-2',
        key: '3-0-2-2',
		isLeaf: true,
           },
		 ]
      },
      {
        title: '中级（讲师级）',
        value: '3-0-2',
        key: '3-0-2',
		isLeaf: true,
      },
	  {
        title: '初级',
        value: '3-0-3',
        key: '3-0-3',
		 children: [
		  {
        title: '助理级（助教级）',
        value: '3-0-3-1',
        key: '3-0-3-1',
		isLeaf: true,
          },
		  {
        title: '员级（教员级）',
        value: '3-0-3-2',
        key: '3-0-3-2',
		isLeaf: true,
           },
		     {
        title: '无职级',
        value: '3-0-3-3',
        key: '3-0-3-3',
		isLeaf: true,
           },

		 ]
      },

    ]
  },

   {
    title: '军队干部职别',
    value: '6',
    key: '6',
    children: [
      {
        title: '军事、政治、后勤、装备军官职别',
        value: '4-0-1',
        key: '4-0-1',
			 children: [
		  {
        title: '军委主席职',
        value: '4-0-2-1',
        key: '4-0-2-1',
		isLeaf: true,
          },
		  {
        title: '军委副主席职',
        value: '4-0-2-2',
        key: '4-0-2-2',
		isLeaf: true,
           },
		    {
        title: '正大军区职',
        value: '4-0-2-3',
        key: '4-0-2-3',
		isLeaf: true,
           },
		    {
        title: '副大军区职',
        value: '4-0-2-4',
        key: '4-0-2-4',
		isLeaf: true,
           },
		    {
        title: '军委委员职',
        value: '4-0-2-5',
        key: '4-0-2-5',
		isLeaf: true,
           },
		 ]
      },
      {
        title: '非专业技术文职干部职务级别',
        value: '5-0-2',
        key: '5-0-2',
			 children: [
		  {
        title: '正部级',
        value: '5-0-2-1',
        key: '5-0-2-1',
		isLeaf: true,
          },
		  {
        title: '副部级',
        value: '5-0-2-2',
        key: '5-0-2-2',
		isLeaf: true,
           },
		     {
        title: '正局级',
        value: '5-0-2-3',
        key: '5-0-2-3',
		isLeaf: true,
           },
		     {
        title: '副局级',
        value: '5-0-2-4',
        key: '5-0-2-4',
		isLeaf: true,
           },
		     {
        title: '正处级',
        value: '5-0-2-5',
        key: '5-0-2-5',
		isLeaf: true,
           },
		 ]
      },
	  {
        title: '专业技术军官、专业技术文职干部和专业技术文职人员技术等级',
        value: '6-0-3',
        key: '6-0-3',
			 children: [
		  {
        title: '专业技术一级',
        value: '6-0-2-1',
        key: '6-0-2-1',
		isLeaf: true,
          },
		  {
        title: '专业技术二级',
        value: '6-0-2-2',
        key: '6-0-2-2',
		isLeaf: true,
           },
		    {
        title: '专业技术三级',
        value: '6-0-2-3',
        key: '6-0-2-3',
		isLeaf: true,
           },
		    {
        title: '专业技术四级',
        value: '6-0-2-4',
        key: '6-0-2-4',
		isLeaf: true,
           },
		    {
        title: '专业技术五级',
        value: '7-0-2-5',
        key: '7-0-2-5',
		isLeaf: true,
           },
		 ]
      },
	  {
        title: '非专业技术文职人员级别',
        value: '7-0-4',
        key: '7-0-4',
			 children: [
		  {
        title: '二级职员',
        value: '7-0-2-1',
        key: '7-0-2-1',
		isLeaf: true,
          },
		  {
        title: '三级职员',
        value: '7-0-2-2',
        key: '7-0-2-2',
		isLeaf: true,
           },
		    {
        title: '四级职员',
        value: '7-0-2-3',
        key: '7-0-2-3',
		isLeaf: true,
           },
		    {
        title: '五级职员',
        value: '7-0-2-4',
        key: '7-0-2-4',
		isLeaf: true,
           },
		    {
        title: '六级职员',
        value: '7-0-2-5',
        key: '7-0-2-5',
		isLeaf: true,
           },
		 ]
      },
	  {
        title: '士官职位级别',
        value: '8-0-5',
        key: '8-0-5',
			 children: [
		  {
        title: '六级士官',
        value: '8-0-2-1',
        key: '8-0-2-1',
		isLeaf: true,
          },
		  {
        title: '五级士官',
        value: '8-0-2-2',
        key: '8-0-2-2',
		isLeaf: true,
           },
		     {
        title: '四级士官',
        value: '8-0-2-3',
        key: '8-0-2-3',
		isLeaf: true,
           },
		     {
        title: '三级士官',
        value: '8-0-2-4',
        key: '8-0-2-4',
		isLeaf: true,
           },
		     {
        title: '二级士官',
        value: '8-0-2-5',
        key: '8-0-2-5',
		isLeaf: true,
           },
		 ]
      },
    ]
  },




];


const workTree = [
  {
    title: '全国公安机关',
    value: '0-0',
    key: '0-0',
    children: [
      {
        title: '内蒙古自治区公安厅',
        value: '0-0-1',
        key: '0-0-1',
		 children: [
		   {
             title: '内设机构',
             value: '0-0-0-1',
             key: '0-0-0-1',
			 			isLeaf: true,
		   },
		   {
             title: '呼和浩特市公安局',
             value: '0-0-0-2',
             key: '0-0-0-2',
			 isLeaf: true,
		   },
		   {
             title: '包头市公安局',
             value: '0-0-0-3',
             key: '0-0-0-3',
			 isLeaf: true,
		   },
		   {
             title: '乌海市公安局',
             value: '0-0-0-4',
             key: '0-0-0-4',
			 isLeaf: true,
		   },
		   {
             title: '鄂尔多斯市公安局',
             value: '0-0-0-5',
             key: '0-0-0-5',
			 isLeaf: true,
		   },

		 ]
      },
      {
        title: '海关总署缉私局',
        value: '0-0-2',
        key: '0-0-2',
		 children: [
		   {
             title: '综合处',
             value: '0-0-2-1',
             key: '0-0-2-1',
			 isLeaf: true,
		   },
		   {
             title: '纪检监察处',
             value: '0-0-2-2',
             key: '0-0-2-2',
			 isLeaf: true,
		   },
		   {
             title: '缉私一处',
             value: '0-0-2-3',
             key: '0-0-2-3',
			 isLeaf: true,
		   },
		   {
             title: '警务装备处',
             value: '0-0-2-4',
             key: '0-0-2-4',
			 isLeaf: true,
		   },
		   {
             title: '石家庄海关缉私局',
             value: '0-0-2-5',
             key: '0-0-2-5',
			 			isLeaf: true,
		   },
		 ]
      },
    ]
  },
];

const changetypeTree = [
  {
    title: '首授',
    value: '0-1',
    key: '0-1',
	isLeaf: true,
  },
  {
    title: '按期晋升',
    value: '0-2',
    key: '0-2',
	isLeaf: true,
  },
  {
    title: '晋职晋升',
    value: '0-3',
    key: '0-3',
	isLeaf: true,
  },
  {
    title: '延期晋升',
    value: '0-4',
    key: '0-4',
	isLeaf: true,
  },
  {
    title: '提前晋升',
    value: '0-5',
    key: '0-5',
	isLeaf: true,
  },
  {
    title: '取消警衔',
    value: '0-6',
    key: '0-6',
	isLeaf: true,
  },
  {
    title: '技术转行政',
    value: '0-7',
    key: '0-7',
	isLeaf: true,
  },
  {
    title: '其它授衔部门转入',
    value: '0-8',
    key: '0-8',
	isLeaf: true,
  },
  {
    title: '微调晋升',
    value: '0-9',
    key: '0-9',
	isLeaf: true,
  },
  {
    title: '警衔降级',
    value: '0-10',
    key: '0-10',
	isLeaf: true,
  },
  {
    title: '选升',
    value: '0-11',
    key: '0-11',
	isLeaf: true,
  },
  {
    title: '不保留警衔',
    value: '0-12',
    key: '0-12',
	isLeaf: true,
  },
  {
    title: '警衔变更',
    value: '0-13',
    key: '0-13',
	isLeaf: true,
  },
  {
    title: '警衔保留',
    value: '0-14',
    key: '0-14',
	isLeaf: true,
  },

];


function getTreeData(req, res, u) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const params = parse(url, true).query;

    let dataSource = treeData;
    const result = {
        list: dataSource,
    };
    return res.json(result);
}

function getpolicerankTree(req, res, u) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const params = parse(url, true).query;

    let dataSource = policerankTree;
    const result = {
        list: dataSource,
    };
    return res.json(result);
}

function getworkTree(req, res, u) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const params = parse(url, true).query;

    let dataSource = workTree;
    const result = {
        list: dataSource,
    };
    return res.json(result);
}

function getdutylevelTree(req, res, u) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const params = parse(url, true).query;

    let dataSource = dutylevelTree;
    const result = {
        list: dataSource,
    };
    return res.json(result);
}

function getchangetypeTree(req, res, u) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const params = parse(url, true).query;

    let dataSource = changetypeTree;
    const result = {
        list: dataSource,
    };
    return res.json(result);
}


function getProDeptTreeByLevelCode (req,res,u,b){
	return getTreeData(req, res, u)
}

function getProDeptTreeByParentid (req,res,u,b){
	return getTreeData(req, res, u)
}




function getPoliceRankTreeByParentid (req,res,u,b){
	return getpolicerankTree(req, res, u)
}
function getWorkTreeByParentid (req,res,u,b){
	return getworkTree(req, res, u)
}

function getDutyLevelTreeByParentid (req,res,u,b){
	return getdutylevelTree(req, res, u)
}

function getChangeTypeTreeByParentid (req,res,u,b){
	return getchangetypeTree(req, res, u)
}




function getProUser(req, res, u) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const params = parse(url, true).query;
    console.log(params);
    if(!params.batchname) {
       params.batchname = "第一批";
    }
    if(!params.status) {
       params.status = 1;
    }
    if(!params.status3) {
       params.status3 = 1;
    }
    let tableListDataSource;
    if(params.parentid == "one") {
        tableListDataSource = [
           {
             title: params.batchname + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
             key: "1",
             children: [
               {parentid: "one",serial_number:"1",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
               {parentid: "one",serial_number:"2",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
               {parentid: "one",serial_number:"3",unit:"内蒙古自治区兴安盟公安局", status: 2,name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
               {parentid: "one",serial_number:"4",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
               {parentid: "one",serial_number:"5",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
               {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
             ]
           },
           {
           	title: params.batchnametwo + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
           	key: '2',
           	children: [
           		{parentid: "two",serial_number:"1",unit:"内蒙古自治区乌海市公安局", name:"武某",status: params.status3, sex:"男", date_of_birth:"1974-06-27", working_hours:"1999-08-24", educational_system:"4", post:"科员", duty_level:"三级警长", appointment_time:"1999-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2014-09-24"},
             ]
           }
        ]
    }
    if(params.selectnum == 1) {
      tableListDataSource = [
          {
            title: params.batchname + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
            key: "one",
            children: [
              {parentid: "one",serial_number:"1",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
              {parentid: "one",serial_number:"2",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
              {parentid: "one",serial_number:"3",unit:"内蒙古自治区兴安盟公安局", status: 2,name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
              {parentid: "one",serial_number:"4",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
              {parentid: "one",serial_number:"5",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
            ]
          }
       ]
    }else if(params.selectnum == 2) {
       tableListDataSource = [
          {
            title: params.batchname + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
            key: "one",
            children: [
              {parentid: "one",serial_number:"1",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
              {parentid: "one",serial_number:"2",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
              {parentid: "one",serial_number:"3",unit:"内蒙古自治区兴安盟公安局", status: 2,name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
              {parentid: "one",serial_number:"4",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
              {parentid: "one",serial_number:"5",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
              {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
            ]
          },
          {
          	title: params.batchnametwo + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
          	key: 'two',
          	children: [
          		{parentid: "two",serial_number:"1",unit:"内蒙古自治区乌海市公安局", name:"武某",status: params.status3, sex:"男", date_of_birth:"1974-06-27", working_hours:"1999-08-24", educational_system:"4", post:"科员", duty_level:"三级警长", appointment_time:"1999-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2014-09-24"},
            ]
          }
       ]
    }else if(params.selectnum == 3) {
      tableListDataSource = [
         {
           title: params.batchname + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
           key: "one",
           children: [
             {parentid: "one",serial_number:"1",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
             {parentid: "one",serial_number:"2",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
             {parentid: "one",serial_number:"3",unit:"内蒙古自治区兴安盟公安局", status: 2,name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
             {parentid: "one",serial_number:"4",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
             {parentid: "one",serial_number:"5",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
             {parentid: "one",serial_number:"6",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
           ]
         },
         {
         	title: params.batchnametwo + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
         	key: 'two',
         	children: [
         		{parentid: "two",serial_number:"1",unit:"内蒙古自治区乌海市公安局", name:"武某",status: params.status3, sex:"男", date_of_birth:"1974-06-27", working_hours:"1999-08-24", educational_system:"4", post:"科员", duty_level:"三级警长", appointment_time:"1999-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2014-09-24"},
          ]
         },
         {
           title: params.batchnamethree + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
           key: "three",
           children: [
             {parentid: "three",serial_number:"1",unit:"内蒙古自治区呼和浩特市公安局", status: params.status,name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
             {parentid: "three",serial_number:"2",unit:"内蒙古自治区呼和浩特市公安局", status: params.status,name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
             {parentid: "three",serial_number:"3",unit:"内蒙古自治区呼和浩特市公安局", status: 1,name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
             {parentid: "three",serial_number:"4",unit:"内蒙古自治区呼和浩特市公安局", status: 1,name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
             {parentid: "three",serial_number:"5",unit:"内蒙古自治区呼和浩特市公安局", status: 1,name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
             {parentid: "three",serial_number:"6",unit:"内蒙古自治区呼和浩特市公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
           ]
         },
      ]
    }else {
      tableListDataSource = [
      	{
      		title: '系统默认筛选(' + moment(new Date()).format("YYYY/MM/DD") + ')',
      		key: "1",
      		children: [
      			{parentid: "1",serial_number:"1",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"陈某", sex:"男", date_of_birth:"1976-08-24", working_hours:"1996-07-24", educational_system:"0", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2008-09-24"},
      			{parentid: "1",serial_number:"2",unit:"内蒙古自治区兴安盟公安局", status: params.status,name:"王某", sex:"男", date_of_birth:"1975-04-24", working_hours:"1992-04-24", educational_system:"0", post:"科员", duty_level:"一级警长", appointment_time:"1998-09-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"一级警督", new_start_time:"2008-07-24"},
      			{parentid: "1",serial_number:"3",unit:"内蒙古自治区兴安盟公安局", status: 1,name:"赵某", sex:"男", date_of_birth:"1973-02-24", working_hours:"1991-03-24", educational_system:"2", post:"主任科员", duty_level:"二级警长", appointment_time:"1998-05-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2016-09-1"},
      			{parentid: "1",serial_number:"4",unit:"内蒙古自治区乌兰察布市公安局", status: 1,name:"周某", sex:"男", date_of_birth:"1980-04-26", working_hours:"1996-03-24", educational_system:"0", post:"主任科员", duty_level:"三级警长", appointment_time:"1998-06-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2025-06-14"},
      			{parentid: "1",serial_number:"5",unit:"内蒙古自治区通辽市公安局", status: 1,name:"章某", sex:"男", date_of_birth:"1989-03-27", working_hours:"1998-04-24", educational_system:"0", post:"科员", duty_level:"二级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"二级警督", new_start_time:"2011-01-30"},
      			{parentid: "1",serial_number:"6",unit:"内蒙古自治区乌海市公安局", status: 1,name:"刘某", sex:"男", date_of_birth:"1975-06-23", working_hours:"1996-08-24", educational_system:"0", post:"主任科员", duty_level:"四级警长", appointment_time:"1998-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"四级警督", new_start_time:"2012-02-22"},
      		]
      	},
      ]
    }
    if(params.parentid == "one") {
       tableListDataSource = [
          {
          	title: params.batchnametwo + '(' + moment(new Date()).format("YYYY/MM/DD") + ')',
          	key: 'two',
          	children: [
          		{parentid: "two",serial_number:"1",unit:"内蒙古自治区乌海市公安局", name:"武某",status: params.status3, sex:"男", date_of_birth:"1974-06-27", working_hours:"1999-08-24", educational_system:"4", post:"科员", duty_level:"三级警长", appointment_time:"1999-04-24", change_type:"首授", incumbent_police_rank:"未授衔", start_time:"", police_rank:"三级警督", new_start_time:"2014-09-24"},
            ]
          }
       ]
    }

    if(params.parentid == "two") {
        tableListDataSource = [];
    }

    let dataSource = tableListDataSource;
    console.log(dataSource);
    if (params.sorter!=undefined) {
        const s = params.sorter.split('_');
        dataSource = dataSource.sort((prev, next) => {
            if (s[1] === 'descend') {
                return next[s[0]] - prev[s[0]];
            }
            return prev[s[0]] - next[s[0]];
        });
    }

    // if (params.status!=undefined) {
    // const status = params.status.split(',');
    // let filterDataSource = [];
    // status.forEach(s => {
    // filterDataSource = filterDataSource.concat(
    // dataSource.filter(data =>
    // {

    //     if(data.status!=undefined){
    //     return parseInt(data.status, 10) === parseInt(s[0], 10);
    //     }
    // })
    // );
    // });
    // dataSource = filterDataSource;
    // }

    // if (params.company!=undefined) {
	   //  // dataSource = dataSource.filter(data => {

	   //  //     if(data.unit!=undefined){
	   //  //     	return data.unit.indexOf(params.company) > -1;
	   //  //     }

	   //  // });

    //   dataSource = dataSource.filter((data) => {
    //       if(data.children) {
    //         data.children = data.children.filter((item) => {
    //           if(item.unit!=undefined){
    //           	return item.unit.indexOf(params.company) > -1;
    //           }
    //         })
    //       }
    //       return data.children.length > 0;
    //   });
    // }

    // if (params.person!=undefined) {
	   //  // dataSource = dataSource.filter(data => {

	   //  //     if(data.name!=undefined){
	   //  //     	return data.name.indexOf(params.person) > -1;
	   //  //     }

	   //  // });
    //   dataSource = dataSource.filter((data) => {
    //       if(data.children) {
    //         data.children = data.children.filter((item) => {
    //           if(item.name!=undefined){
    //           	return item.name.indexOf(params.person) > -1;
    //           }
    //         })
    //       }
    //       return data.children.length > 0;
    //   });
    // }

    if (params.name!=undefined) {
      dataSource = dataSource.filter((data) => {
          if(data.children) {
            data.children = data.children.filter((item) => {
              if(item.name!=undefined){
              	return item.name.indexOf(params.name) > -1;
              }
            })
          }
          return data.children.length > 0;
      });
    }

    if (params.police_rank!=undefined) {


	    // dataSource = dataSource.filter(data => {

	    //     if(data.police_rank!=undefined){
	    //     	return data.police_rank.indexOf(params.police_rank) > -1;
	    //     }

	    // });

      dataSource = dataSource.filter((data) => {
          if(data.children) {
            data.children = data.children.filter((item) => {
              if(item.police_rank!=undefined){
              	return item.police_rank.indexOf(params.police_rank) > -1;
              }
            })
          }
          return data.children.length > 0;
      });
    }

    if (params.duty_level!=undefined) {
	    // dataSource = dataSource.filter(data => {

	    //     if(data.duty_level!=undefined){
	    //     	return data.duty_level.indexOf(params.duty_level) > -1;
	    //     }

	    // });
      dataSource = dataSource.filter((data) => {
          if(data.children) {
            data.children = data.children.filter((item) => {
              if(item.duty_level!=undefined){
              	return item.duty_level.indexOf(params.duty_level) > -1;
              }
            })
          }
          return data.children.length > 0;
      });
    }

    if (params.change_type!=undefined) {
	    // dataSource = dataSource.filter(data => {

	    //     if(data.change_type!=undefined){
	    //     	return data.change_type.indexOf(params.change_type) > -1;
	    //     }

	    // });
      dataSource = dataSource.filter((data) => {
          if(data.children) {
            data.children = data.children.filter((item) => {
              if(item.change_type!=undefined){
              	return item.change_type.indexOf(params.change_type) > -1;
              }
            })
          }
          return data.children.length > 0;
      });
    }

    let pageSize = 10;
    if (params.pageSize!=undefined) {
        pageSize = params.pageSize * 1;
    }

    const result = {
        list: dataSource,
        pagination: {
            total: dataSource.length,
            pageSize,
            current: parseInt(params.currentPage, 10) || 1,
        },
    };

    return res.json(result);
}



function deleteByPrimaryKeyForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;

    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



    return getProUser(req, res, u);
}


function selectByPrimaryKeyForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}



function insertForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;



    const i = Math.ceil(Math.random() * 10000);
    tableListDataSource.unshift({
        user_id: `李海波 user_id ${i}`,
        user_name: `李海波 user_name ${i}`,
        user_name_cn: `李海波 user_name_cn ${i}`,
        password: `李海波 password ${i}`,
        enabled: `李海波 enabled ${i}`,
        is_system_user: `李海波 is_system_user ${i}`,
        creator_id: `李海波 creator_id ${i}`,
        dept_code: `李海波 dept_code ${i}`,
        inner_dept_code: `李海波 inner_dept_code ${i}`,
        org_code: `李海波 org_code ${i}`,
        inner_org_code: `李海波 inner_org_code ${i}`,
        memos: `李海波 memos ${i}`,
        avatar: `李海波 avatar ${i}`,
        email: `李海波 email ${i}`,
        phone: `李海波 phone ${i}`,
        dept: `李海波 dept ${i}`,
        job: `李海波 job ${i}`,
        createTime: `李海波 createTime ${i}`,
        status: Math.floor(Math.random() * 10) % 4,
    });


    return getProUser(req, res, u);
}


function updateForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;

    if(id!=undefined)
    tableListDataSource = tableListDataSource.map(item => {
        if (item.id === id) {
        Object.assign(item, { desc, name });
        return item;
    }
    return item;
});


    return getProUser(req, res, u);
}


function deleteByMapForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}



function updateByMapForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}

function getOneForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(undefined!=id)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



    return getProUser(req, res, u);
}

function getAllForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



    return getProUser(req, res, u);
}

function queryPageForProUser(req, res, u, b) {


    return getProUser(req, res, u);
}

function countForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}


function insertBatchForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}



function deleteBatchForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}


function updateBatchForProUser(req, res, u, b) {
    let url = u;
    if (!url || Object.prototype.toString.call(url) !== '[object String]') {
        url = req.url; // eslint-disable-line
    }

    const body = (b && b.body) || req.body;
    const { method, name, age, id } = body;


    if(id!=undefined)
    tableListDataSource = tableListDataSource.filter(item => id.indexOf(item.id) === -1);



return getProUser(req, res, u);
}




export default {
    'GET /${webpath}/web/api/service/prouser/delete': deleteByPrimaryKeyForProUser,
    'GET /${webpath}/web/api/service/prouser/get': selectByPrimaryKeyForProUser,
    'POST /${webpath}/web/api/service/prouser/insert': insertForProUser,
    'POST /${webpath}/web/api/service/prouser/update': updateForProUser,
    'POST /${webpath}/web/api/service/prouser/deleteByMap': deleteByMapForProUser,
    'POST /${webpath}/web/api/service/prouser/updateByMap': updateByMapForProUser,
    'POST /${webpath}/web/api/service/prouser/getOne': getOneForProUser,
    'POST /${webpath}/web/api/service/prouser/getAll': getAllForProUser,


    'POST /${webpath}/web/api/service/prouser/count': countForProUser,
    'POST /${webpath}/web/api/service/prouser/insertBatch': insertBatchForProUser,
    'POST /${webpath}/web/api/service/prouser/deleteBatch': deleteBatchForProUser,
    'POST /${webpath}/web/api/service/prouser/updateBatch': updateBatchForProUser,
    'POST /${webpath}/web/api/service/prouser/updateBatch': updateBatchForProUser,

    'POST /${webpath}/web/api/service/prodept/getProDeptTreeByLevelCode': getProDeptTreeByLevelCode,
    'POST /platform_server/web/api/service/prodept/getProDeptTreeByParentid': getProDeptTreeByParentid,




    'POST /platform_server/web/api/service/policestaffselect/getPoliceRankTreeByParentid': getPoliceRankTreeByParentid,
    'POST /platform_server/web/api/service/policestaffselect/getWorkTreeByParentid': getWorkTreeByParentid,
    'POST /platform_server/web/api/service/policestaffselect/getDutyLevelTreeByParentid': getDutyLevelTreeByParentid,
    'POST /platform_server/web/api/service/policestaffselect/getChangeTypeTreeByParentid': getChangeTypeTreeByParentid,
    'POST /platform_server/web/api/service/policestaffselect/queryPage': queryPageForProUser,
};
